/*******************************************************************************
*
* (c) Copyright 2014 Freescale Semiconductor
*
****************************************************************************//*!
*
* @file     SysCfg.h
*
* @author   Salvador Zendejas
*
* @version  0.0.1
*
* @date      Aug 22, 2014
*
* @brief    System Configurator for Kinetis K.
*
*******************************************************************************/

#ifndef SYSCFG_H_
#define SYSCFG_H_

/*******************************************************************************
* Includes
*******************************************************************************/
#include "derivative.h" /* Include peripheral declarations */
#include "typedef.h" /* Include typedef declarations */


/*******************************************************************************
* Constants and macros
*******************************************************************************/

#define _DEBUG_			YES
#define _CLKOUT_		NO

#define FRDM_KL25		NO
#define FRDM_K64F		YES
#define MK64FN1M0VLL12	YES

#define _BOARD_			FRDM_K64F
#define _MCU_			MK64FN1M0VLL12

#define kHz				1000
#define MHz				kHz * kHz
#define GHz				MHz * kHz

#define Clk50MHz		50 * MHz
#define Clk32kHz		32768

#if (_MCU_ == MK64FN1M0VLL12)
	#define RAMSIZE		(256 * 1024)
	#define SYSTEM_CLK	(120 * MHz)	//	@120MHz
	#define BUS_CLK		SYSTEM_CLK / 2	//	@60MHz
#endif

#if (_BOARD_ == FRDM_K64F)
/*change according to use on the App*/
#define UART5			NOT_USED
#define UART4			NOT_USED
#define I2C2			NOT_USED
#define DAC1			NOT_USED
#define DAC0			NOT_USED
#define ENET			NOT_USED
#define ADC1			NOT_USED
#define FTM3			NOT_USED
#define FTM2			NOT_USED
#define SDHC			NOT_USED
#define SPI2			NOT_USED
#define RNGA			NOT_USED
#define VREF			NOT_USED
#define CMP				NOT_USED	/*Comparator*/
#define USBOTG			NOT_USED
#define UART3			NOT_USED
#define UART2			NOT_USED
#define UART1			NOT_USED
#define UART0			NOT_USED
#define I2C1			NOT_USED
#define I2C0			NOT_USED
#define CMT				NOT_USED
#define EWM				NOT_USED	/*External Watchdog Monitor*/
#define PORTE			TO_USE
#define PORTD			NOT_USED
#define PORTC			NOT_USED
#define PORTB			TO_USE
#define PORTA			NOT_USED
#define LPTMR			NOT_USED	/*Low Power Timer Access Control*/

	#define _RGB_LED_
	#define _ACCELEROMETER_	FXOS8700CQ
	#define _MAGNETOMETER_	FXOS8700CQ
	#define _SW1_
	#define _SW2_
	#define _ETHERNET_
	#define _SDHC_			MCG_MemMapPtr
	#define _RF_			nRF24L01
	#define _BLUETOOTH_		JY_MCU_BT
	#define _Clk50MHz_		50 * MHz
	#define _Clk32MHz_		32768

#elif (_BOARD_ == FRDM_KL25)
	#define _RGB_LED_
	#define _ACCELEROMETER_	FXOS8700CQ
	#define _MAGNETOMETER_	FXOS8700CQ
	#define _SW1_
	#define _SW2_
#endif

#define TICKs_10MS			SYSTEM_CLK / 1000
#define TICKs_1MS			SYSTEM_CLK / 10000
/*******************************************************************************
* Types Definitions
*******************************************************************************/

#endif /* SYSCFG_H_ */
